public class Singleton {

    private static volatile Singleton s; //cpu 最新缓存

    public static Singleton getInstance() {
        if(s==null){
            synchronized (Singleton.class){
                s=new Singleton();
            }
        }
        return s;
    }

    private Singleton(){
        System.out.println("------------");

    }
}
